<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
	String basePath = path + request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>添加用戶信息</title>
<link rel="stylesheet" href="layui/css/layui.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="layui/layui.js"></script>
<script src="js/jquery.min.js"></script>
</head>
<body>
	<div class="container-fuid">
		<form id="form-user-add" class="form-horizontal layui-form" action="Attendence/add" method="post"
			enctype="multipart/form-data" lay-filter="userForm">
			<input type="hidden" name="userId"> <input type="hidden"
				name="sysDept.deptId" id="deptId_add" />
			<h4 class="form-header h4">基本信息</h4>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label"><span
							style="color: red;">*</span>用户名称：</label>
						<div class="col-sm-8">
							<input name="staffname" placeholder="请输入用户名称" class="form-control"
								type="text" maxlength="30" required lay-verify="required">
						</div>
					</div>
						<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-4 control-label">用户性别：</label>
						<div class="col-sm-8">
							<select name="sex" class="form-control m-b">
								<option value="0">男</option>
								<option value="1">女</option>
								<option value="2">未知</option>
							</select>
						</div>
					</div>
				</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label"><span
							style="color: red;">*</span>签到时间：</label>
						<div class="col-sm-8">
							<input id="endTime"name="attendin" placeholder="请输入签到时间" class="form-control"
								type="text" maxlength="30" required lay-verify="required">
						</div>
					</div>
					</div>
					
					<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label"><span
							style="color: red;">*</span>签退时间：</label>
						<div class="col-sm-8">
							<input  id="beginTime"name="attendout" placeholder="请输入签退时间" class="form-control"
								type="text" maxlength="30" required lay-verify="required">
						</div>
					</div>
					</div>
			</div>
		
		
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-xs-2 control-label">部门：</label>
						<div class="col-xs-4">
							<select id="deptid" class="form-control select2-multiple"
								name="depatrment.deptid" >
								
								
								
							</select>
						</div>
					</div>
				</div>
			

			
				<h4 class="form-header h4">其他信息</h4>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-xs-2 control-label">备注：</label>
							<div class="col-xs-10">
								<textarea name="remark" maxlength="500" class="form-control"
									rows="3"></textarea>
							</div>
						</div>
					</div>
				</div>

			</div>
			<button id="btnAddUser" submit" class="btn btn-success" lay-submit lay-filter="formDemo">提交</button>
		</form>
	</div>
				
			
	
	
<script type="text/javascript">

$(function(){
	layui.use(['layer','form','laydate' ],function(){
		layui.laydate.render({
			elem : '#endTime',
				type:"time"
		});
		layui.laydate.render({
			elem : '#beginTime',
			type:"time"
		});
		
		
	});
	
	loadPosts();
	
	
})
	
	
	
	
	
	function loadPosts() {
		$.get('Attendence/listdept', function(data) {
			$.each(data, function() {
				let opt = $("<option></option>").appendTo("#deptid");
				opt.val(this.deptid).html(this.deptname);
			});
			layui.formSelects.render("select");
		});
	}
	
	
</script>
</body>
</html>